minutes = int(input())
hours = minutes // 60
days = hours // 24
year = days // 365
day = days % 365
print(year)
print(day)